package com.woniu.system.pojo;

import com.woniu.components.DAO.IEntity;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * SysDictionaryId entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Embeddable
public class SysDictionaryId implements IEntity {

	// Fields

	private Long NTypeId;
	private String SCode;

	// Constructors

	/** default constructor */
	public SysDictionaryId() {
	}

	/** full constructor */
	public SysDictionaryId(Long NTypeId, String SCode) {
		this.NTypeId = NTypeId;
		this.SCode = SCode;
	}

	// Property accessors

	@Column(name = "N_TYPE_ID", unique = false, nullable = false, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getNTypeId() {
		return this.NTypeId;
	}

	public void setNTypeId(Long NTypeId) {
		this.NTypeId = NTypeId;
	}

	@Column(name = "S_CODE", unique = false, nullable = false, insertable = true, updatable = true, length = 20)
	public String getSCode() {
		return this.SCode;
	}

	public void setSCode(String SCode) {
		this.SCode = SCode;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof SysDictionaryId))
			return false;
		SysDictionaryId castOther = (SysDictionaryId) other;

		return ((this.getNTypeId() == castOther.getNTypeId()) || (this
				.getNTypeId() != null
				&& castOther.getNTypeId() != null && this.getNTypeId().equals(
				castOther.getNTypeId())))
				&& ((this.getSCode() == castOther.getSCode()) || (this
						.getSCode() != null
						&& castOther.getSCode() != null && this.getSCode()
						.equals(castOther.getSCode())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getNTypeId() == null ? 0 : this.getNTypeId().hashCode());
		result = 37 * result
				+ (getSCode() == null ? 0 : this.getSCode().hashCode());
		return result;
	}

}